FROM microsoft/aspnetcore:2.0.3 AS base
WORKDIR /app

FROM microsoft/aspnetcore-build:2.0.3 AS build
WORKDIR /src
COPY ServerManager/ServerManager.csproj ServerManager/
RUN dotnet restore ServerManager/ServerManager.csproj
COPY . .
WORKDIR /src/ServerManager
RUN dotnet build ServerManager.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish ServerManager.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ServerManager.dll"]
